package cn.wolfcode.shop.cloud.util;

import cn.wolfcode.shop.cloud.redis.KeyPrefix;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
@AllArgsConstructor
public class SeckillKeyPrefix implements KeyPrefix {
    private int expireTime;
    private String keyPrefix;

    @Override
    public int getExpireTime() {
        return this.expireTime;
    }

    @Override
    public String getKeyPrefix() {
        return this.keyPrefix;
    }

    public static final SeckillKeyPrefix SECKILL_GOOD_STOCK = new SeckillKeyPrefix(0, "seckill_good_stock:");
    public static final SeckillKeyPrefix SECKILL_CREATE_ORDER = new SeckillKeyPrefix(0, "seckill_create_order:");
    public static final SeckillKeyPrefix SECKILL_GOOD_HASH = new SeckillKeyPrefix(0, "seckill_good_hash");
    public static final SeckillKeyPrefix SECKILL_PATH = new SeckillKeyPrefix(10, "seckill_path:");
    public static final SeckillKeyPrefix SECKILL_VERIFY_CODE = new SeckillKeyPrefix(10, "seckill_verify_code:");
}
